<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.blockchain.front.servlets.trading.PjDz"%>
<%@page import="com.blockchain.util.http.URLParameter"%>
<%@page import="com.blockchain.front.servlets.financial.AbstractFinancialServlet"%>
<%@page import="com.blockchain.front.servlets.trading.AddPj"%>
<%@page import="com.blockchain.front.service.trading.entity.PjEntity"%>
<%@page import="com.blockchain.front.service.trading.entity.HqEntity"%>
<%@page import="com.blockchain.front.service.trading.entity.WtEntity"%>
<%@page import="com.blockchain.common.enums.JymmType"%>
<%@page import="com.blockchain.front.servlets.trading.ajax.WtCjjl"%>
<%@page import="com.blockchain.front.servlets.trading.ajax.WtMc"%>
<%@page import="com.blockchain.front.servlets.trading.ajax.WtMr"%>
<%@page import="com.blockchain.front.servlets.trading.ajax.Hq"%>
<%@page import="com.blockchain.front.service.trading.entity.XlbEntity"%>
<%@page import="com.blockchain.front.servlets.financial.CxWt"%>
<%@page import="com.blockchain.front.service.financial.entity.JlEntity"%>
<%@page import="com.blockchain.front.service.trading.TradingManage"%>
<%@page
	import="com.blockchain.front.service.financial.entity.UserZhEntity"%>
<%@page import="com.blockchain.front.service.financial.FinancialManage"%>
<%@page import="com.blockchain.common.enums.IsPass"%>
<html>
<head>
<%
String str = languageDefine.getValue(request, "menu_tradeCenter");
String _TITLE_ = str+"- "+configureProvider.getProperty(SystemVariable.SITE_NAME);
final int currentPage = IntegerParser.parse(request.getParameter("paging.current"));
int scid = IntegerParser.parse(request.getParameter("id"));
if(scid==0){
	scid=(int)request.getAttribute("scid");
}
URLParameter parameter = new URLParameter(request,controller.getViewURI(request,CommentMarket.class));
	FinancialManage financialManage = serviceSession.getService(FinancialManage.class);
	TradingManage tradingManage = serviceSession.getService(TradingManage.class);
	XlbEntity b = tradingManage.getB(scid);
	HqEntity[] hqlist = tradingManage.hqList();
	JYZX_SELECT_TABLE_INDEX = 2;
	PagingResult<PjEntity> result=tradingManage.searchPj(scid,new Paging() {
		public int getCurrentPage() {
			return currentPage;
		}

		public int getSize() {
			return 10;
		}
	});
	PjEntity [] pjs=result.getItems();	
	PjEntity pf=tradingManage.pf(scid);
%>
<title><%=_TITLE_%></title>
<%@include file="/WEB-INF/include/meta.jsp"%>
<%@include file="/WEB-INF/include/style.jsp"%>
</head>
<!--菜单-->
 <%@include file="/WEB-INF/include/trading/left.jsp"%>
<body>
	<div class="header bg_w"
		style="position: fixed; z-index: 99; height: 120px;">
		<!--头部-->
		<%@include file="/WEB-INF/include/trading/header.jsp"%>
		<!--交易行情-->
		<%@include file="/WEB-INF/include/trading/hq.jsp"%>
	</div>

	<div class="wrapbody">
		<div class="main">
			<div class="myright"
				style="width: 1200px; padding: 0px;">
				<div class="wraphtml">
					<div class="autobox mt20 clear" style="padding-top: 0px;">
						<div class="maintain-content">
							<div class="coin-intro">
								<h4 class="intro-title" style="margin-top: 0;">(<%StringHelper.filterHTML(out, b.ywm_s);%>)<%=languageDefine.getValue(request, "intro_score")%></h4>
								<div class="box-padding-add13">
									<div class="star-level">
										<%=languageDefine.getValue(request, "intro_ratedStarRating")%>：
										<ul id="star">
											<li class="active"></li>
											<li class="active"></li>
											<li class="active"></li>
											<li class="active"></li>
											<li><i style="width: 92.592592592593"></i></li>
										</ul>
										（ <%=languageDefine.getValue(request, "intro_votersNumber")%><span style="color: #e55600;"><%=pf.tprs%></span> ）
									</div>
									<div class="level-content">
										<%
										BigDecimal js=new BigDecimal(0);
										BigDecimal yy=new BigDecimal(0);
										BigDecimal qj=new BigDecimal(0);
										BigDecimal jss=new BigDecimal(0);
										BigDecimal yys=new BigDecimal(0);
										BigDecimal qjs=new BigDecimal(0);
										if(pf.tprs>0){
											 jss=new BigDecimal(pf.js).divide(new BigDecimal(pf.tprs), 2,BigDecimal.ROUND_HALF_UP);
											 yys=new BigDecimal(pf.yy).divide(new BigDecimal(pf.tprs), 2,BigDecimal.ROUND_HALF_UP);
											 qjs=new BigDecimal(pf.qj).divide(new BigDecimal(pf.tprs), 2,BigDecimal.ROUND_HALF_UP);
										}
										
										BigDecimal p=new BigDecimal(pf.tprs).multiply(new BigDecimal(5));
										if(p.compareTo(new BigDecimal(0))>0){
											 js=new BigDecimal(pf.js).divide(p, 2,BigDecimal.ROUND_HALF_UP);
											 yy=new BigDecimal(pf.yy).divide(p, 2,BigDecimal.ROUND_HALF_UP);
											 qj=new BigDecimal(pf.qj).divide(p, 2,BigDecimal.ROUND_HALF_UP);
										}
										
										%>
										<ul>
											<li><%=languageDefine.getValue(request, "intro_technicalScore")%>：
												<div class="progress">
													<div class="progress-bar" style="width:<%=js.multiply(new BigDecimal(100))%>%"></div>
												</div> <span style="color: #e55600;"><%=jss%><%=languageDefine.getValue(request, "intro_fen")%></span>
											</li>
											<li><%=languageDefine.getValue(request, "intro_applicationScore")%>：
												<div class="progress">
													<div class="progress-bar" style="width: <%=yy.multiply(new BigDecimal(100))%>%"></div>
												</div> <span style="color: #e55600;"><%=yys%><%=languageDefine.getValue(request, "intro_fen")%></span>
											</li>
											<li><%=languageDefine.getValue(request, "intro_foregroundScore")%>：
												<div class="progress">
													<div class="progress-bar" style="width: <%=qj.multiply(new BigDecimal(100))%>%"></div>
												</div> <span style="color: #e55600;"><%=qjs%><%=languageDefine.getValue(request, "intro_fen")%></span>
											</li>
										</ul>
									</div>
								</div>
							</div>
							<form action="<%=controller.getURI(request, AddPj.class)%>" method="post" id="form" >
							<input type="hidden" name="scid" value="<%=scid%>">
							<div class="link-cc">
								<h4 class="intro-title"><%=languageDefine.getValue(request, "intro_talkSome")%></h4>
								<div class="box-padding-add13">
									<div style="width: 50%; float: left;">
										<textarea id="msgaaa" class="text-area" name="nr"></textarea>
										<div class="pinglun-bonus" style="margin-top: 15px;">
											<%if (blockchainSession == null || !blockchainSession.isAuthenticated()) {%>
											<a class="sub-comment" href="javascript:void(0)" onclick="loginpop('<%=controller.getURI(request, LoginVerify.class)%>');"><%=languageDefine.getValue(request, "intro_sumbitComments")%></a>
											 <%}else{%>
											 <a onclick="upcomment()" class="sub-comment"><%=languageDefine.getValue(request, "intro_sumbitComments")%></a>
											 <%}%>
										</div>
									</div>
									<div style="width: 50%; float: left;">
										<ol class="score-ol">
											<li><%=languageDefine.getValue(request, "intro_technicalScore")%>：<label><input name="js" type="radio"
													checked="checked" value="5">&nbsp;5<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="js" type="radio" value="4">&nbsp;4<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="js" type="radio" value="3">&nbsp;3<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="js" type="radio" value="2">&nbsp;2<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="js" type="radio" value="1">&nbsp;1<%=languageDefine.getValue(request, "intro_fen")%></label>
											</li>
											<li><%=languageDefine.getValue(request, "intro_applicationScore")%>：<label><input name="yy" type="radio"
													checked="checked" value="5">&nbsp;5<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="yy" type="radio" value="4">&nbsp;4<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="yy" type="radio" value="3">&nbsp;3<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="yy" type="radio" value="2">&nbsp;2<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="yy" type="radio" value="1">&nbsp;1<%=languageDefine.getValue(request, "intro_fen")%></label>
											</li>
											<li><%=languageDefine.getValue(request, "intro_foregroundScore")%>：<label><input name="qj" type="radio"
													checked="checked" value="5">&nbsp;5<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="qj" type="radio" value="4">&nbsp;4<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="qj" type="radio" value="3">&nbsp;3<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="qj" type="radio" value="2">&nbsp;2<%=languageDefine.getValue(request, "intro_fen")%></label><label><input
													name="qj" type="radio" value="1">&nbsp;1<%=languageDefine.getValue(request, "intro_fen")%></label>
											</li>
										</ol>
									</div>
								</div>
							</div>
						</form>
						<form action="<%=controller.getURI(request, CommentMarket.class)%>" method="post" id="form" >
						<input type="hidden" name="scid" value="<%=scid%>">
							<div class="detail-Parameter" style="width: 1060px;">
								<h4 class="intro-title"><%=languageDefine.getValue(request, "intro_allTalking")%></h4>
								<div style="border-bottom: 1px dotted #dcdcdc; padding-bottom: 20px;">
									<%if(pjs!=null){for(PjEntity pj:pjs){int count=tradingManage.conut(pj.id); %>
									
									<div class="single-comment" id="single-comment-7379">
										<div class="comment-title">
											<div>
												<span style="color: #ff731e;"><%StringHelper.truncationMpno(out,pj.iphone);%></span> <span
													style="color: #777; padding-left: 3px;"><%=languageDefine.getValue(request, "intro_commentTalking")%>：</span> 
													<span style="float: right; margin-right: 10px;">
													<%if(count==0){%> 
													<a href="<%=controller.getURI(request, PjDz.class)%>?scid=<%=scid%>&&type=<%=1%>&pjid=<%=pj.id%>"><span  class="dianzan"> <%=languageDefine.getValue(request, "intro_nice")%> </span>
													</a>
													<span class="dianzan-value" id="zan_7379_2">(<%=pj.hao%>)</span>
												 <a href="<%=controller.getURI(request, PjDz.class)%>?scid=<%=scid%>&&type=<%=2%>&pjid=<%=pj.id%>"><span  class="dianzan">
														<%=languageDefine.getValue(request, "intro_moderation")%> <span class="dianzan-value" id="zan_7379_1">(<%=pj.zhong%>)</span>
												</span></a><a href="<%=controller.getURI(request, PjDz.class)%>?scid=<%=scid%>&&type=<%=3%>&pjid=<%=pj.id%>"> <span  class="dianzan">
														<%=languageDefine.getValue(request, "intro_nonsense")%> <span class="dianzan-value" id="zan_7379_0">(<%=pj.cha%>)</span>
												</span></a>
												<%}else{%>
												<span  class="dianzan"> <%=languageDefine.getValue(request, "intro_nice")%> </span>
												<span class="dianzan-value" id="zan_7379_2">(<%=pj.hao%>)</span>
												<span  class="dianzan">
												<%=languageDefine.getValue(request, "intro_moderation")%> <span class="dianzan-value" id="zan_7379_1">(<%=pj.zhong%>)</span>
												</span>
												<span  class="dianzan">
												<%=languageDefine.getValue(request, "intro_nonsense")%> <span class="dianzan-value" id="zan_7379_0">(<%=pj.cha%>)</span>
												</span>
												<%}%>
												</span>
											</div>
										</div>
										<div class="comment-content"><%StringHelper.filterHTML(out,pj.nr);%></div>
										<span><%=TimestampParser.format(pj.sj)%></span>
									</div>
									<%}} %>
								</div>
								  <%AbstractFinancialServlet.rendPagingResult(out, result);%> 
							</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<%@include file="/WEB-INF/include/footer.jsp"%>
	<%@include file="/WEB-INF/include/script.jsp"%>
	<script type="text/javascript">
var scid=<%=scid%>;
var hq_url='<%=controller.getURI(request, Hq.class)%>';
$(function(){
hq();//行情
window.setInterval("hq();",2000);
});
function hq(){//行情
var data = {"scid" : scid};
	$.ajax({
		type : "post",
		dataType : "html",
		url : hq_url,
		data : data,
		success : function(data) {
			var ct = eval('(' + data + ')');
			if (ct.num>0) {
			$("#market_new_price").html(ct.msg.dqj);
			$("#market_max_price").html(ct.msg.zgj);
			$("#market_min_price").html(ct.msg.zdj);	
			$("#market_buy_price").html(ct.msg.mr_yj);
			$("#market_sell_price").html(ct.msg.mc_yj);
			$("#market_volume").html(ct.msg.cjl);
			$("#market_change").html(ct.msg.rzd+"%"); 
			if(ct.msg.rzd>=0){
				$('#market_change').removeClass('green');
			    $('#market_change').addClass('text_red');
			}
			scid=ct.msg.scid;
			}
		}
	});
}
function upcomment(){
var msgaaa=$("#msgaaa").val();
if ( msgaaa.length<=0||msgaaa=="") {
	layer.tips('<%=languageDefine.getValue(request, "js_commentCannotNull")%>', '#msgaaa', {tips:3});
	return false;
}
if ( msgaaa.length >250) {
	layer.tips('<%=languageDefine.getValue(request, "js_max250")%>', '#msgaaa', {tips:3});
	return false;
}
$("#form").submit();
}
<%String error = controller.getPrompt(request,response,PromptLevel.ERROR);if(!StringHelper.isEmpty(error)){%>
layer.open({
	title: '<%=languageDefine.getValue(request, "js_tip")%>',
	content: '<%=languageDefine.getValue(request, error)%>'
	<%-- content: <%=error.indexOf("err_")!=-1?"eval(\"alert(\'sdf\')\")":error%> --%>
});  
<%}%>
</script>
</body>
</html>

